<?php

require_once '../function/connection.php';

include '../view/user_panel.php';


if (isset($_SESSION['zalogowany'])) {

    connection();
    $email = $_SESSION['use_email'];
    $sHtml = '<div class="container"><table class="table table-striped table-bordered table-condensed"><tr><td style="width:140px;">Status: </td><td style="width:130px;">Data: </td><td style="width:100px;">Godzina: </td><td>Opis: </td></tr>';

    $query = "SELECT * FROM `rezerwacje` join `user` on `user`.`USE_1_ID` = `rezerwacje`.`rez_useid` where `user`.`USE_EMAIL` = '$email' " ;
    $result = mysql_query($query);
    for($i=0; $i<mysql_num_rows($result); $i++){
        $row = mysql_fetch_assoc($result);
        $sHtml .= '<tr><td>'.$row['rez_status']  .'</td>'. '<td>' .$row['rez_data'] .'</td>' .'<td>'. $row['rez_godzina'] .'</td>'.'<td>'.$row['rez_opis'].'</td></tr>';
    }
    
    $sHtml .= '</table></div>';
    echo $sHtml;
    
}

include '../view/footer.php';
?>